package cn.jbolt.ai.klb.service.impl;

import cn.jbolt.ai.klb.dao.AiDocAnswerMapper;
import cn.jbolt.ai.klb.entity.AiDocAnswer;
import cn.jbolt.ai.klb.service.AiDocAnswerService;
import cn.jbolt.util.Result;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class AiDocAnswerServiceImpl extends ServiceImpl<AiDocAnswerMapper, AiDocAnswer> implements AiDocAnswerService {
    @Override
    public Result<AiDocAnswer> add(AiDocAnswer aiDocAnswer) {

        boolean save = this.save(aiDocAnswer);
        if (save) {
            return Result.success(aiDocAnswer);
        }

        return Result.error("添加失败");
    }

    @Override
    public Result<AiDocAnswer> delete(Long id) {
        boolean b = removeById(id);
        if (b) {
            return Result.success();
        }
        return Result.error("删除失败");
    }
}
